<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Luat开源项目脚本lib</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>script_LuaTask lib</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>


<h2>Modules</h2>
<ul class="nowrap">
  <li><strong>aLiPay</strong></li>
  <li><a href="../modules/aLiYun.html">aLiYun</a></li>
  <li><a href="../modules/aLiYunOta.html">aLiYunOta</a></li>
  <li><a href="../modules/agps.html">agps</a></li>
  <li><a href="../modules/audio.html">audio</a></li>
  <li><a href="../modules/cc.html">cc</a></li>
  <li><a href="../modules/clib.html">clib</a></li>
  <li><a href="../modules/common.html">common</a></li>
  <li><a href="../modules/console.html">console</a></li>
  <li><a href="../modules/errDump.html">errDump</a></li>
  <li><a href="../modules/gizwits.html">gizwits</a></li>
  <li><a href="../modules/gps.html">gps</a></li>
  <li><a href="../modules/gpsv2.html">gpsv2</a></li>
  <li><a href="../modules/gpsv3.html">gpsv3</a></li>
  <li><a href="../modules/http.html">http</a></li>
  <li><a href="../modules/httpv2.html">httpv2</a></li>
  <li><a href="../modules/lbsLoc.html">lbsLoc</a></li>
  <li><a href="../modules/led.html">led</a></li>
  <li><a href="../modules/link.html">link</a></li>
  <li><a href="../modules/log.html">log</a></li>
  <li><a href="../modules/misc.html">misc</a></li>
  <li><a href="../modules/mqtt.html">mqtt</a></li>
  <li><a href="../modules/net.html">net</a></li>
  <li><a href="../modules/netLed.html">netLed</a></li>
  <li><a href="../modules/ntp.html">ntp</a></li>
  <li><a href="../modules/nvm.html">nvm</a></li>
  <li><a href="../modules/patch.html">patch</a></li>
  <li><a href="../modules/pb.html">pb</a></li>
  <li><a href="../modules/pins.html">pins</a></li>
  <li><a href="../modules/pm.html">pm</a></li>
  <li><a href="../modules/powerKey.html">powerKey</a></li>
  <li><a href="../modules/record.html">record</a></li>
  <li><a href="../modules/ril.html">ril</a></li>
  <li><a href="../modules/scanCode.html">scanCode</a></li>
  <li><a href="../modules/sim.html">sim</a></li>
  <li><a href="../modules/sms.html">sms</a></li>
  <li><a href="../modules/socket.html">socket</a></li>
  <li><a href="../modules/sys.html">sys</a></li>
  <li><a href="../modules/uiWin.html">uiWin</a></li>
  <li><a href="../modules/update.html">update</a></li>
  <li><a href="../modules/utils.html">utils</a></li>
  <li><a href="../modules/wdt.html">wdt</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>aLiPay</code></h1>
<p>模块功能：蚂蚁金服支付宝功能.</p>
<p></p>
    <h3>Info:</h3>
    <ul>
        <li><strong>Copyright</strong>: openLuat</li>
        <li><strong>Release</strong>: 2019.03.31</li>
        <li><strong>License</strong>: MIT</li>
        <li><strong>Author</strong>: openLuat</li>
    </ul>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#close">
    close (<strong  style="color: gray;">[cbFnc=nil]</strong>)
    </a></td>
	<td class="summary">关闭aLiPay（注意：关闭aLiPay之后，只能重启才能再次自动开启）</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#setup">
    setup (deviceSupplier, merchantUser, itemId, productKey, getTerminalIdFnc)
    </a></td>
	<td class="summary">配置支付宝产品参数</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#sendTransactionData">
    sendTransactionData (<strong  style="color: gray;">[businessNo=""]</strong><strong  style="color: gray;">[, qrcode=""]</strong><strong  style="color: gray;">[, amount=-1]</strong><strong  style="color: gray;">[, timeConsuming=-1]</strong><strong  style="color: gray;">[, tradeResult=0]</strong><strong  style="color: gray;">[, cbFnc=nil]</strong>)
    </a></td>
	<td class="summary">缓存交易信息数据（注意：缓存成功后，并不是立即上报，而是缓存到一定条数之后才会上报）</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#sendProductInfoData">
    sendProductInfoData (humanVerify<strong  style="color: gray;">[, cbFnc=nil]</strong>)
    </a></td>
	<td class="summary">缓存产品规格信息数据（注意：缓存成功后，并不是立即上报，而是缓存到一定条数之后才会上报）</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#sendActData">
    sendActData (broadcastCnt, scanCnt<strong  style="color: gray;">[, cbFnc=nil]</strong>)
    </a></td>
	<td class="summary">缓存行为数据（注意：缓存成功后，并不是立即上报，而是缓存到一定条数之后才会上报）</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#on">
    on (evt, cbFnc)
    </a></td>
	<td class="summary">注册事件的处理函数</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#getBiztid">
    getBiztid ()
    </a></td>
	<td class="summary">获取设备的biztid(注意，必须在connectCb之后才能获取成功)</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#sign">
    sign (mode, data<strong  style="color: gray;">[, amount=nil]</strong><strong  style="color: gray;">[, cbFnc=nil]</strong>)
    </a></td>
	<td class="summary">对待交易数据进行加签</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Functions"></a>Functions</h2>

    <dl class="function">
    <dt>
    <a name = "close"></a>
    <strong  style="color: red;">
    close (<strong  style="color: green;">[cbFnc=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">关闭aLiPay（注意：关闭aLiPay之后，只能重启才能再次自动开启）</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">cbFnc</span>
            <span class="types"><span class="type">function</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">关闭结果的回调函数
 回调函数的调用形式为：cbFnc(result)。result为true表示关闭成功，false或者nil表示关闭失败</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">aLiPay.close(cbFnc)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "setup"></a>
    <strong  style="color: red;">
    setup (deviceSupplier, merchantUser, itemId, productKey, getTerminalIdFnc)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">配置支付宝产品参数</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">deviceSupplier</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">设备供应商编号</pre>
        </li>
        <li><span class="parameter">merchantUser</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">设备运营商编号</pre>
        </li>
        <li><span class="parameter">itemId</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">产品身份识别号</pre>
        </li>
        <li><span class="parameter">productKey</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">设备行业和设备形态的精简描述</pre>
        </li>
        <li><span class="parameter">getTerminalIdFnc</span>
            <span class="types"><span class="type">function</span></span>
        <pre class="example">获取设备的序列号的函数</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">aLiPay.setup(<span class="string">"201903131900940927"</span>,<span class="string">"201903131900940927"</span>,<span class="string">"2019031301993185"</span>,<span class="string">"SMART_RETAIL_MODULE"</span>,getTerminalId)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "sendTransactionData"></a>
    <strong  style="color: red;">
    sendTransactionData (<strong  style="color: green;">[businessNo=""]</strong><strong  style="color: green;">[, qrcode=""]</strong><strong  style="color: green;">[, amount=-1]</strong><strong  style="color: green;">[, timeConsuming=-1]</strong><strong  style="color: green;">[, tradeResult=0]</strong><strong  style="color: green;">[, cbFnc=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">缓存交易信息数据（注意：缓存成功后，并不是立即上报，而是缓存到一定条数之后才会上报）</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">businessNo</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
         [<em>此参数可选，默认值为：</em> ""]
        <pre class="example">交易产生的流水号</pre>
        </li>
        <li><span class="parameter">qrcode</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
         [<em>此参数可选，默认值为：</em> ""]
        <pre class="example">用户付款码</pre>
        </li>
        <li><span class="parameter">amount</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> -1]
        <pre class="example">交易金额，单位为分</pre>
        </li>
        <li><span class="parameter">timeConsuming</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> -1]
        <pre class="example">交易时间耗费，单位为秒</pre>
        </li>
        <li><span class="parameter">tradeResult</span>
            <span class="types"><span class="type">number</span></span>
         [<em>此参数可选，默认值为：</em> 0]
        <pre class="example">交易结果</pre>
        </li>
        <li><span class="parameter">cbFnc</span>
            <span class="types"><span class="type">function</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">数据缓存结果的回调函数
 回调函数的调用形式为：cbFnc(result)。result为true表示缓存成功，false或者nil表示缓存失败</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">aLiPay.sendTransactionData(<span class="string">"88899998888"</span>,<span class="string">"98765"</span>,<span class="number">1234</span>,<span class="number">4</span>,<span class="number">5</span>,<span class="number">0</span>,cbFnc)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "sendProductInfoData"></a>
    <strong  style="color: red;">
    sendProductInfoData (humanVerify<strong  style="color: green;">[, cbFnc=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">缓存产品规格信息数据（注意：缓存成功后，并不是立即上报，而是缓存到一定条数之后才会上报）</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">humanVerify</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">设备核查消费者身份的方式，可以是如下列表中的一种或者多种之和
      0x01 二维码识别
      0x02 人脸识别
      0x04 手机号码识别(SMS/CALL)
      0x08 声纹识别
      0x10 NFC识别
      0x20 指纹识别
      0x40 邮箱识别</pre>
        </li>
        <li><span class="parameter">cbFnc</span>
            <span class="types"><span class="type">function</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">数据缓存结果的回调函数
      回调函数的调用形式为：cbFnc(result)。result为true表示缓存成功，false或者nil表示缓存失败</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">aLiPay.sendProductInfoData(<span class="number">0x01</span>,cbFnc)
aLiPay.sendProductInfoData(<span class="number">0x01</span>+<span class="number">0x02</span>+<span class="number">0x04</span>,cbFnc)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "sendActData"></a>
    <strong  style="color: red;">
    sendActData (broadcastCnt, scanCnt<strong  style="color: green;">[, cbFnc=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">缓存行为数据（注意：缓存成功后，并不是立即上报，而是缓存到一定条数之后才会上报）</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">broadcastCnt</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">语音播报次数增量</pre>
        </li>
        <li><span class="parameter">scanCnt</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">扫码次数增量</pre>
        </li>
        <li><span class="parameter">cbFnc</span>
            <span class="types"><span class="type">function</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">数据缓存结果的回调函数
      回调函数的调用形式为：cbFnc(result)。result为true表示缓存成功，false或者nil表示缓存失败</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">aLiPay.sendActData(<span class="number">1</span>,<span class="number">2</span>,cbFnc)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "on"></a>
    <strong  style="color: red;">
    on (evt, cbFnc)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">注册事件的处理函数</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">evt</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">事件
 "connect"表示接入服务器连接结果事件</pre>
        </li>
        <li><span class="parameter">cbFnc</span>
            <span class="types"><span class="type">function</span></span>
        <pre class="example">事件的处理函数
 当evt为"connect"时，cbFnc的调用形式为：cbFnc(result)，result为true表示连接成功，false或者nil表示连接失败</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">aLiPay.on(<span class="string">"connect"</span>,connectCbFnc)</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "getBiztid"></a>
    <strong  style="color: red;">
    getBiztid ()
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">获取设备的biztid(注意，必须在connectCb之后才能获取成功)</pre>



    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">aLiPay.getBiztid()</pre></il>
    </ul>

</dd>
    <dt>
    <a name = "sign"></a>
    <strong  style="color: red;">
    sign (mode, data<strong  style="color: green;">[, amount=nil]</strong><strong  style="color: green;">[, cbFnc=nil]</strong>)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">对待交易数据进行加签</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">mode</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">交易数据类型
      1 用户被扫
      2 用户人脸
      3 用户主扫
      4 第三方代扣</pre>
        </li>
        <li><span class="parameter">data</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">需要加签的数据，最大长度为 128 字节</pre>
        </li>
        <li><span class="parameter">amount</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">需要加签的数据，单位为元，最大长度为 32 字节，例如"0.01"表示1分钱</pre>
        </li>
        <li><span class="parameter">cbFnc</span>
            <span class="types"><span class="type">function</span></span>
         [<em>此参数可选，默认值为：</em> nil]
        <pre class="example">加签结果的回调函数
      回调函数的调用形式为：cbFnc(result,signedData)。result为true表示加签成功，false或者nil表示加签失败；signedData为加签后的数据</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">nil</pre></il>
    </ul>



    <h3>Usage:</h3>
    <ul>
        <li><pre class="example">aLiPay.sign(<span class="number">1</span>,<span class="string">"sign_data"</span>,<span class="string">"100"</span>,cbFnc)</pre></il>
    </ul>

</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2019-11-19 10:46:53 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

